| Conditions | 5 |
| Total Lines | 20 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import {Event} from './Event.entity'; |
||
| 42 | |||
| 43 | public calculateNumberOfMealTicket( |
||
| 44 | overview: IEventsOverview, |
||
| 45 | eventsByDate: any[] |
||
| 46 | ): IEventsOverview { |
||
| 47 | for (const sortedEvent of eventsByDate) { |
||
| 48 | let totalPerDay = 0; |
||
| 49 | |||
| 50 | for (const {time, type} of sortedEvent) { |
||
| 51 | if (Event.WORKED_TYPES.includes(type)) { |
||
| 52 | totalPerDay += time; |
||
| 53 | } |
||
| 54 | } |
||
| 55 | |||
| 56 | if (totalPerDay > 0.5) { |
||
| 57 | overview.mealTicket++; |
||
| 58 | } |
||
| 59 | } |
||
| 60 | |||
| 61 | return overview; |
||
| 62 | } |
||
| 64 |